package com.lqe.mapper;

import com.lqe.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;


public interface UserMapper {
    @Select("select *,id userId from t_user")

    List<User> queryAllUser();

    List<User> queryUserAndRole();

    @Select("select *,id userId from t_user where id = #{id}")
    User queryUserById(int id);

    @Insert("insert into t_user values(#{userId},#{username},#{age})")
    void insertUser(User user);

    @Delete("delete from t_user where id = #{id}")
    void deleteUserById(int id);

    @Update("update t_user set username = #{username},age = #{age} where id = #{userId}")
    void updateUser(User user);

}
